package com.lianniu.mgr.supplyManage.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lianniu.mgr.base.BaseResult;
import com.lianniu.mgr.pagination.PaginationInfo;
import com.lianniu.mgr.supplyManage.service.ISupplyCommissionService;
import com.lianniu.mgr.supplyManage.vo.CommissionConditionVo;
import com.lianniu.mgr.supplyManage.vo.SupplyCommissionVo;

@Controller
@RequestMapping("/rest/supplyCommission")
public class SupplyCommissionRestController {

  @Autowired
  ISupplyCommissionService commissionService;
  @RequestMapping("/commissionList")
  public @ResponseBody BaseResult commissionList(CommissionConditionVo condition, 
      PaginationInfo paginationInfo){
    
    return commissionService.getCommissionListForPage(condition, paginationInfo);
  }
  
  @RequestMapping("/getCommission")
  public @ResponseBody BaseResult getCommission(String supplyID){
    
    return commissionService.getCommission(supplyID);
  }
  
  @RequestMapping("/deleteCommission")
  public @ResponseBody BaseResult deleteCommission(String ids){
    
    return commissionService.deleteCommission(ids);
  }
  
  @RequestMapping("/editCommission")
  public @ResponseBody BaseResult editCommission(SupplyCommissionVo commission){
    
    return commissionService.editCommission(commission);
  }
}
